package com.qf.springboot.async;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * projectName: springboot
 *
 * @author dongshihao
 * Date:2021/9/12   22:02
 * description:
 */
@Component
public class LikeSleep {

    @Async
    public void sleep()  {
        System.out.println(Thread.currentThread().getName());
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("启动了");
    }
}
